{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=365
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,j,n,cur,kk:longint;
	a:array[0..1010,0..1010] of int64;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
fillchar(a,sizeof(a),0);
read(n);
kk:=2*n+1;
for i:=0 to kk+1 do begin
	a[i][0]:=maxlongint;
	a[0][i]:=maxlongint;
	a[kk+1][i]:=maxlongint;
	a[i][kk+1]:=maxlongint;
end;
cur:=kk*kk-1; 
i:=0;
j:=kk+1;
while cur>=0 do begin
	dec(j);
	inc(i);
	while (a[i][j]=0) and (cur>=0) do begin
		a[i][j]:=cur;
		dec(cur);
		inc(i);
	end;
	dec(i);
	dec(j);
	while(a[i][j]=0) and (cur>=0) do begin
		a[i][j]:=cur;
		dec(cur);
		dec(j);
	end;
	inc(j);
	dec(i);
	while(a[i][j]=0) and (cur>=0) do begin
		a[i][j]:=cur;
		dec(cur);
		dec(i);
	end;
	inc(i);
	inc(j);
	while (a[i][j]=0) and (cur>=0) do begin
		a[i][j]:=cur;
		dec(cur);
		inc(j);
	end;
end;
for i:=1 to kk do begin
	for j:=1 to kk do
		write(a[i][j],' ');
	writeln;
end;
end.